home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
jmod311.zip
/
JMODEM_A.C
< prev
next >
Wrap
Text File
|
1992-02-02
|
40KB
|
610 lines
/****************************************************************************/
/* FILE JMODEM_A.C */
/* */
/* The JMODEM protocol MicroSoft (r) 'C' V6.00 */
/* Created 03-FEB-1990 Richard B. Johnson */
/* 405 Broughton Drive */
/* Beverly, Massachusetts 01915 */
/* BBS (508) 922-3166 */
/* */
/* An external protocol for high-speed data transmission. */
/* */
/* This is the MAIN module */
/* The required modules are: */
/* JMODEM.H (function prototypes and structures) */
/* UART.H (8250 UART parameters) */
/* SCREEN.H (function protypes and structures for the screen) */
/* JMODEM_A.C (this module) */
/* JMODEM_B.C (memory allocation and input parsing) */
/* JMODEM_C.C (all file I/O) */
/* JMODEM_D.C (encode/decode and CRC routines) */
/* JMODEM_E.C (communications I/O routines) */
/* JMODEM_F.C (the screen I/O routines) */
/* JMODEM_G.ASM (Interrupt service routines after V3.10) */
/* JMODEM. (The MAKE file ) */
/* */
/* This program requires about 67k of free RAM to execute properly. */
/* If you have 66k or less, it will execute, but the screens will */
/* not be written or replaced properly. If you have only 64k, the */
/* program will exit with an error message. */
/* */
/* Revision History: */
/* V3.00 Beta test 11-FEB-1990 Richard B. Johnson */
/* V3.01 First release 18-FEB-1990 Richard B. Johnson */
/* V3.02 Revised 19-FEB-1990 Richard B. Johnson */
/* */
/* (1) A bug in MicroSoft _calloc() allocates overlapping */
/* buffers so data files were getting corrupted. I had */
/* used both _calloc() and _malloc() at the same time and */
/* they didn't like it. I changed the memory allocation */
/* to _malloc() only and it seems to work okay. */
/* */
/* (2) While debugging, I found some structures I didn't need and */
/* removed them. Changed some code to accommodate. */
/* */
/* (3) Added a file-size during downloads. */
/* */
/* (4) Changed code in the data encoding (compression) routine */
/* in an attempt to speed it up. */
/* */
/* V3.03 Revised 20-FEB-1990 Richard B. Johnson */
/* */
/* (5) Fixed bug in compression routine where the loop wasn't */
/* terminating properly, adding random characters. Bug was */
/* created during V3.02 change. */
/* */
/* V3.04 Revised 27-FEB-1990 Richard B. Johnson */
/* */
/* (1) Modified the block-size routine and the receive-block */
/* routine in an attempt to improve the noise immunity. */
/* Does not abort even if you whistle into the telephone */
/* during uploads and downloads. Waits 5 seconds to clear */
/* the interrupt buffer when a bad block-size is received. */
/* */
/* (2) Added a 1/2 second wait for modem status when opening */
/* channel. This might accommodate slow modems response to */
/* RTS. */
/* */
/* V3.05 Revised 22-MAR-1990 Richard B. Johnson */
/* */
/* (1) Removed _sprintf() runtime library calls to shorten */
/* the code. Saved about 4k. */
/* */
/* (2) Removed extra spaces in the signon-logo to shorten */
/* the program size. */
/* */
/* (3) Changed the method of creating a fixed-length string */
/* for both the block size and cps numbers which saved about */
/* 800 bytes of program size. */
/* */
/* (4) Changed numerous array indexes in JMODEM_F.C to pointers */
/* to reduce code size. Saved a few hundred bytes and should */
/* improve speed of screen output. */
/* */
/* (5) Created a local _puts() routine which saved over 6k from the */
/* MicroSoft C runtime library version. (JMODEM_F.C) */
/* */
/* V3.06 Revised 07-APR-1990 Richard B. Johnson */
/* */
/* (1) Put the filename text into the syst structure as a pointer */
/* to char. This allowed me to save 56 bytes of code and now */
/* only two parameters are passed to the _screen() function. */
/* */
/* (2) Modified the syst structure and supporting code. */
/* */
/* (3) Moved all external data and functions to the JMODEM.H file. */
/* */
/* (4) Moved _disp() "usage" module to JMODEM_F.C */
/* */
/* (5) Changed arrays in JMODEM_B.C to pointers to reduce code- */
/* size. Eliminated _strcpy() from the command-line parsing */
/* routines. Brought the code-size to less than 12,000 bytes. */
/* */
/* (6) Reduced the code-s